package cn.cxion.chat.app.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.makeramen.roundedimageview.RoundedImageView;

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import cn.cxion.chat.R;
import cn.cxion.chat.app.bean.CheckContractBean;
import cn.cxion.chat.app.bean.OnHandInfo;
import cn.cxion.chat.app.constant.Constant;
import cn.cxion.chat.app.view.OnHandItemView;


public class OnHandAdapter extends RecyclerView.Adapter<OnHandAdapter.ViewHold> {
    OnHandItemView onHandItemView;
    @NonNull
    @Override
    public ViewHold onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
         onHandItemView=new OnHandItemView(context);
        return new ViewHold(onHandItemView.getView());
    }

    @Override
    public void onBindViewHolder(@NonNull ViewHold holder, int position) {
        onHandItemView.bindView(list.get(position));

    }

    @Override
    public int getItemCount() {
          return list==null?0:list.size();
    }

    private List<CheckContractBean> list;
    private Context context;

    public OnHandAdapter(Context context){
        this.context=context;
    }

    public void setList(List<CheckContractBean> list) {
        this.list = list;
    }

    public List<CheckContractBean> getList() {
        return list;
    }

    class ViewHold extends RecyclerView.ViewHolder {

        public ViewHold(@NonNull View itemView) {
            super(itemView);
        }
    }

}
